import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/workbench',
    children:[
      {path: '/workbench', component: () => import('../views/workbench/WorkbenchView.vue')},
      {path: '/dict', component: () => import('../views/dictionary/DictView.vue')},
      {path: '/dictOption', component: () => import('../views/dictionary/DictOptionView.vue')},
      {path: '/processCenter', component: () => import('../views/process/ProcessCenterView.vue')},
      {path: '/calendar', component: () => import('../views/calendar/CalendarView.vue')},
      {path: '/expense', component: () => import('../views/finance/expenseApplication.vue')},
      {path: '/purchase', component: () => import('../views/finance/purchaseApplication.vue')},
      {path: '/purchaseAdd', component: () => import('../views/finance/purchaseAdd.vue')},
      {path: '/entry', component: () => import('../views/personnel/entryView.vue')},
      {path: '/regular', component: () => import('../views/personnel/regularView.vue')},
      {path: '/department', component: () => import('../views/personnel/departmentView.vue')},
      {path: '/resignation', component: () => import('../views/personnel/resignationView.vue')},
      {path: '/meeting', component: () => import('../views/administration/MeetingView.vue')},
      {path: '/finance', component: () => import('../views/finance/FinanceView.vue')},
      {path: '/invoice', component: () => import('../views/finance/InvoiceView.vue')},
      {path: '/paymentApplication', component: () => import('../views/finance/PaymentApplicationView.vue')},
      {path: '/reimbursementApplication', component: () => import('../views/finance/ReimbursementApplicationView.vue')},
        {path: '/leaveApplication', component: () => import('../views/process/LeaveApplication.vue')},
        {path: '/employeeApplication', component: () => import('../views/process/EmployeeApplication.vue')},
        {path: '/equipmentApplication', component: () => import('../views/process/EquipmentApplication.vue')},
        {path: '/meetingRoom', component: () => import('../views/process/MeetingRoom.vue')},
        {path: '/regularApplication', component: () => import('../views/process/regularApplication.vue')},
        {path: '/resignationApplication', component: () => import('../views/process/resignationApplication.vue')},
        {path: '/departmentApplication', component: () => import('../views/process/departmentApplication.vue')}
    ]
  },
  {path: '/login', component: () => import('../views/LoginView.vue')}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
